Name TyleTools
OutFile "Tyle.exe"
Caption "Tyle Installer"
InstallDir $PROGRAMFILES\TyleTools
InstallDirRegKey HKLM SOFTWARE\TyleTools "Install_Dir"

DirText "Enter Installation Folder"

Section "Tyle (required)"
  ; Set output path to the installation directory.
  SetOutPath "$INSTDIR\Tyle"
	File /r "..\export\*"
	
  WriteRegStr HKLM SOFTWARE\TyleTools "Install_Dir" "$INSTDIR"
  ; Write the uninstall keys for Windows
  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\TyleTools" "DisplayName" "TyleTools (remove only)"
  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\TyleTools" "UninstallString" '"$INSTDIR\Tyle\uninstall.exe"'
  WriteUninstaller "Tyle\uninstall.exe"
SectionEnd ; end the section

; optional section
Section "Start Menu Shortcuts"
  CreateDirectory "$SMPROGRAMS\TyleTools"
  CreateShortCut "$SMPROGRAMS\TyleTools\Tyler (Tyle shell).lnk" "$INSTDIR\Tyle\tyler.bat" "" "$INSTDIR\Tyle\tyler.bat" 0
  CreateShortCut "$SMPROGRAMS\TyleTools\Tyle reference.lnk" "$INSTDIR\Tyle\tyle.html" "" "$INSTDIR\Tyle\tyle.html" 0
  CreateShortCut "$SMPROGRAMS\TyleTools\Tyle Uninstall.lnk" "$INSTDIR\Tyle\uninstall.exe" "" "$INSTDIR\Tyle\uninstall.exe" 0
SectionEnd

; uninstall stuff

UninstallText "This will uninstall Tyle. Hit next to continue."

; special uninstall section.
Section "Uninstall"
  ; remove registry keys
  DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Tyle"
  RMDir /r "$INSTDIR"
  ; remove shortcuts, if any.
  Delete "$SMPROGRAMS\TyleTools\Tyle*"
  ; remove directories used.
SectionEnd
